#include "stdafx.h"
#include "CppUnitTest.h"

#include "../Geometry/Vector3d.h"
//
#include "../Geometry/Line3d.h"
//
#include "../Geometry/Point3d.h"

#include "../Geometry/Plane3d.h"
#include "../Geometry/Plane3d.cpp"

using Geometry::Vector3d;
using Geometry::Line3d;
using Geometry::Point3d;
using Geometry::Plane3d;

using namespace Microsoft::VisualStudio::CppUnitTestFramework;

namespace GeometryTests
  {
  TEST_CLASS(UnitTestPlane3d)
    {
    public:
      TEST_METHOD(ShouldContainPointsCorrectly)
        {
        Plane3d p(Point3d(0, 0, 0), Vector3d(0, 0, 1));
        Point3d p_in_1(10, 20, 0);
        Point3d p_in_2(20, -100, 0);
        Point3d p_out_1(0, 0, 1);
        Point3d p_out_2(10, 20, -10);

        Assert::IsTrue(p.ContainsPoint(p_in_1));
        Assert::IsTrue(p.ContainsPoint(p_in_2));

        Assert::IsFalse(p.ContainsPoint(p_out_1));
        Assert::IsFalse(p.ContainsPoint(p_out_2));
        }

    };
  }